
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpQuartzWork.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpQuartzWorkForm"
 */
public class CcpQuartzWorkForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cqwGuid = null;
   private java.lang.String _workName = null;
   private java.lang.String _workRemark = null;
   private java.lang.String _workState = null;
   private java.lang.String _startTime = null;
   private java.lang.String _endTime = null;
   private java.lang.String _scheduleType = null;
   private java.lang.Integer _scheduleFrequency = null;
   private java.lang.String _schedulePeriod = null;
   private java.lang.String _groupGuid = null;

   /**
    * Standard constructor.
    */
   public CcpQuartzWorkForm() {
   }

   /**
    * Returns the cqwGuid
    *
    * @return the cqwGuid
    */
   public java.lang.String getCqwGuid() {
      return _cqwGuid;
   }

   /**
    * Sets the cqwGuid
    *
    * @param cqwGuid the new cqwGuid value
    */
   public void setCqwGuid(java.lang.String cqwGuid) {
      _cqwGuid = cqwGuid;
   }
   /**
    * Returns the workName
    *
    * @return the workName
    */
   public java.lang.String getWorkName() {
      return _workName;
   }

   /**
    * Sets the workName
    *
    * @param workName the new workName value
    */
   public void setWorkName(java.lang.String workName) {
      _workName = workName;
   }
   /**
    * Returns the workRemark
    *
    * @return the workRemark
    */
   public java.lang.String getWorkRemark() {
      return _workRemark;
   }

   /**
    * Sets the workRemark
    *
    * @param workRemark the new workRemark value
    */
   public void setWorkRemark(java.lang.String workRemark) {
      _workRemark = workRemark;
   }
   /**
    * Returns the workState
    *
    * @return the workState
    */
   public java.lang.String getWorkState() {
      return _workState;
   }

   /**
    * Sets the workState
    *
    * @param workState the new workState value
    */
   public void setWorkState(java.lang.String workState) {
      _workState = workState;
   }
   /**
    * Returns the startTime
    *
    * @return the startTime
    */
   public java.lang.String getStartTime() {
      return _startTime;
   }

   /**
    * Sets the startTime
    *
    * @param startTime the new startTime value
    */
   public void setStartTime(java.lang.String startTime) {
      _startTime = startTime;
   }
   /**
    * Returns the endTime
    *
    * @return the endTime
    */
   public java.lang.String getEndTime() {
      return _endTime;
   }

   /**
    * Sets the endTime
    *
    * @param endTime the new endTime value
    */
   public void setEndTime(java.lang.String endTime) {
      _endTime = endTime;
   }
   /**
    * Returns the scheduleType
    *
    * @return the scheduleType
    */
   public java.lang.String getScheduleType() {
      return _scheduleType;
   }

   /**
    * Sets the scheduleType
    *
    * @param scheduleType the new scheduleType value
    */
   public void setScheduleType(java.lang.String scheduleType) {
      _scheduleType = scheduleType;
   }
   /**
    * Returns the scheduleFrequency
    *
    * @return the scheduleFrequency
    */
   public java.lang.Integer getScheduleFrequency() {
      return _scheduleFrequency;
   }

   /**
    * Sets the scheduleFrequency
    *
    * @param scheduleFrequency the new scheduleFrequency value
    */
   public void setScheduleFrequency(java.lang.Integer scheduleFrequency) {
      _scheduleFrequency = scheduleFrequency;
   }
   /**
    * Returns the schedulePeriod
    *
    * @return the schedulePeriod
    */
   public java.lang.String getSchedulePeriod() {
      return _schedulePeriod;
   }

   /**
    * Sets the schedulePeriod
    *
    * @param schedulePeriod the new schedulePeriod value
    */
   public void setSchedulePeriod(java.lang.String schedulePeriod) {
      _schedulePeriod = schedulePeriod;
   }
   /**
    * Returns the groupGuid
    *
    * @return the groupGuid
    */
   public java.lang.String getGroupGuid() {
      return _groupGuid;
   }

   /**
    * Sets the groupGuid
    *
    * @param groupGuid the new groupGuid value
    */
   public void setGroupGuid(java.lang.String groupGuid) {
      _groupGuid = groupGuid;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCqwGuid() == null) {
         errors.add("cqwGuid", new ActionError("error.cqwGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
